package cn.tips.dmp.supports.jpa;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;

/**
 * @author pkb
 */
@MappedSuperclass
public class BaseJpaSnowflakeIdEntity implements Serializable {
    @Id
    @GenericGenerator(
            name = "snowflake-id",
            strategy = "cn.tips.dmp.supports.jpa.SnowflakeIdGenerator"
    )
    @GeneratedValue(
            generator = "snowflake-id"
    )
    @Column(
            name = "id"
    )
    protected Long id;

    public BaseJpaSnowflakeIdEntity() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(final Long id) {
        this.id = id;
    }

}
